class Dog(object):
    def __init__(self, name):
        self.name = name

    def game(self):
        print(f"{self.name}只会简单的玩耍")


class XiaoTianQuan(Dog):
    def game(self):
        """重写父类方法"""
        print(f"{self.name}在天上玩耍")


xh = Dog("小黄")
xtq = XiaoTianQuan("天神")


class Person(object):
    def __init__(self, name):
        self.name = name

    def play_with_dog(self, dog):
        print(f"{self.name}与{dog.name}玩耍")
        dog.game()

# 创建人对象
xm = Person("小明")
# 调用方法
xm.play_with_dog(xh)
xm.play_with_dog(xtq)
